#include<bits/stdc++.h>
using namespace std;
char a[256],b[256];
int main()
{
	cin>>a;
	int n=strlen(a);
	
	for (int i=0; i<n; i++)
	{
		switch(a[i])
		{
			case 'A':b[i]='T';break;
			case 'C':b[i]='G';break;
			case 'T':b[i]='A';break;
			case 'G':b[i]='C';break;
		}
	}
	
	cout<<b<<endl;
	
	return 0;
}